package Collection;

import java.util.ArrayList;
import java.util.List;

/**
 * @author chihb
 * @create-time 2024/6/20 21:08
 * @description
 */
public class ArrayListDemo {
    public static void main(String[] args) {
        ArrayList<String> list=new ArrayList<>();
        list.add("hh");
        list.add("fd");
        list.add("33");
        list.add("44");
        System.out.println(list.size());
        list.add(3,"99");
        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }
        list.set(3,"66");
        list.remove(1);
        list.remove("44");
        System.out.println("--------------------");
        for(String i:list){
            System.out.println(i);
        }
    }
}
